<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>淘格子，淘分享 登录窗口</title>
<script type="text/javascript" src="__PUBLIC__/JS/mootools/mootools-core-1.3.2-full-compat-yc.js"></script>
<script type="text/javascript" src="http:/taogezi.sinaapp.com/Public/JS/Base.js"></script>	
<script type="text/javascript" src="__PUBLIC__/JS/Utils/md5-min.js"></script>
<script type="text/javascript" src="__PUBLIC__/JS/Common.js"></script>	
 <script language="JavaScript">
window.addEvent('domready', function() {
    if((Cookie.read('keepLogin')=='true'))
	{	//alert('Cookie keepLogin Value is: '+Cookie.read('keepLogin'));
		;$('chk').checked = true;
		$('user_id').value = Cookie.read('user_id');
		$('password').value = Cookie.read('password');
		$('user_id').readonly = true;
		$('password').readonly = true;		

		var myRequest = new Request.JSON({
		method: 'get', 
		url: '__APP__/AuthACL/_ajaxLogin/',
		data: 'userid='+Cookie.read('user_id')+'&password='+Cookie.read('password'),
		headers: 'Content-Type:text/html; charset=utf-8',
		onSuccess: function(data){

			Loperate(data);
		},
		onFailure: function(){

			$('result').set('text', '请求失败.');
				}	
		}).send();
		
	}
	});

	function Loperate(data)
	{
		if(data[0]['status']=='ok')
		{
		window.location.href='__APP__/Index/panel';		
		}
		else
		{
		$('rest').innerHTML =data[0]['msg'];
		}
	}


	function keydown(e){
		var e = e || event;
		if (e.keyCode==13)
		{
		$('submit').click();
		}
	}
	
	function fleshVerify(type){ 
		var timenow = new Date().getTime();
		if (type)
		{
		$('verifyImg').src= '__APP__/Index/verify/adv/1/'+timenow;
		}else{
		$('verifyImg').src= '__APP__/Index/verify/'+timenow;
		}	
	}

	function goRegUrl(){

		 window.location.href='__APP__/AuthACL/reg';	
	}
	
	function chkRem(id){
		if(($(id).checked == true))
		{
		$('checked').value = 'true';
		}	
		else
		{
		$('checked').value = 'false';
		}
	}

</script>

<style type="text/css">
<!--
.b1,.b2,.b3,.b4,.b1b,.b2b,.b3b,.b4b,.b{display:block;overflow:hidden;height:305px;}
.b1,.b2,.b3,.b1b,.b2b,.b3b{height:1px;}
.b2,.b3,.b4,.b2b,.b3b,.b4b,.b{border-left:1px solid #999;border-right:1px solid #999;}
.b1,.b1b{margin:0 5px;background:#999;}
.b2,.b2b{margin:0 3px;border-width:2px;}
.b3,.b3b{margin:0 2px;}
.b4,.b4b{height:2px;margin:0 1px;}
.d1{background: #FFFFFF;}
-->
</style>
</head>
<body style="text-align:center;" onLoad="document.login.user_id.focus()" >
<div style=" margin-top:75px; margin-left:auto; margin-right:auto;width:455px; height:355px;";>
<b class="b1"></b><b class="b2 d1"></b><b class="b3 d1"></b><b class="b4 d1"></b>
<div class="b d1" >

<form method='post' name="login" id="form1" action="__APP__/AuthACL/checkLogin" >
<div >
<table id="checkList" align="center"  cellpadding=0 cellspacing=0 >
<tr><td height="5" colspan="2" ></td></tr>
<tr >
  <Th colspan="2"  > <img src="__PUBLIC__/images/tgz.jpg" /></th>
</tr>
<tr><td height="5" colspan="2" ></td></tr>
<tr  ><td colspan="2" ><div id="result" ></div></td></tr>
<tr  ><td  width="25%">帐 号：</td><td><input type="text"  check="Require" warning="请输入帐号" id="user_id" name="user_id" style="width:120px;"></td></tr>
<tr  ><td >密 码：</td><td><input id="password" type="password"  check="Require" onBlur="if((this.value).length<16){this.value=hex_md5(this.value);}"   warning="请输入密码" name="password" style="width:120px;"></td></tr>
<tr  ><td >验证码：</td><td><input type="text" onKeyDown="keydown(event)"  check="Require" warning="请输入验证码" name="verify" style="width:120px;"> 
<img id="verifyImg" SRC="__APP__/Index/verify/" onClick="fleshVerify()" BORDER="0" ALT="点击刷新验证码" style="cursor:pointer" align="absmiddle"></td></tr>
<tr><td align="center"><input name="chk" type="checkbox" id="chk" onClick="chkRem(this.id);" checked="checked" />
<input type="text" style="display:none" name="checked" id="checked" value="true" /></td><td>记住登陆状态</td></tr>
<tr ><td align="center" colspan="2">
<input type="submit" value="登 录" id="submit"  > 
<input name="submit" type="button" onClick="goRegUrl()"  id="regbtn" value="注 册" /></td>
</tr>
<tr><td height="5" colspan="2"></td></tr>
</table>
<div id="rest" >系统需要登陆后使用</div>
</div>
</form>

</div>
<b class="b4b d1"></b><b class="b3b d1"></b><b class="b2b d1"></b><b class="b1b"></b>

</div>
</body>
</html>